
list1=[]
for i in range(1,5):
    for j in range(1,5):
        for k in range(1,5):
            for l in range(1,5):
                if (i!=j and i!=k and i!=l) and (j!=k and j!=l) and (k!=l):
                    t=i*1000+j*100+k*10+l
                    for s in range(2,t-1):
                        if t%s==0:
                            break
                        else:
                            print(t)
                            break


# a = ['1', '2', '3', '4']
# b = []
# for i in a:
#     print(i)
#     for j in [x for x in a if x != i]:
#         print(j)
#         for m in [x for x in a if x != i and x != j]:
#             print(m)
#             b.append(int(i + j + m))
# print(b)
# print('互不相同且无重复数字的三位数总计 %s 个' % len(b))



